package edu.xpu.project.user.entity;

import java.io.Serializable;
import java.util.Date;
import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * @ClassName: ProjectUser.java
 * @Description: 人员实体类
 *
 * @author liukang
 * @date 2017年4月17日 9:30:04
 * @version 
 * @since JDK 1.6
 */
@Entity(name="ProjectUser")
@Table(name="XPU_USER")
public class ProjectUser implements Serializable {
	
	private static final long serialVersionUID = -7594243612614253802L;

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private Long id;

	private String name;				//姓名
	private String loginName;			//登录名
	private String pwd;					//密码
	
	/*
	 * 0: 女生
	 * 1: 男生
	 */
	private Integer sex;				//性别
	
	private String examineeNumber;		//准考证号
	/*
	 * 0: 不是借读生
	 * 1: 是借读生
	 */
	private Integer isTransientStu;		//是否是借读生
	
	/*
	 * 文科、理科、综合
	 */
	private String subjectType;			//科目类型
	
	private Date birthDay;				//生日
	private String userNo;				//人员编号(学生是学号, 老师则是编号)
	
	/*----------------- 系统属性 -------------------*/
	/*
	 * 1: 学生
	 * 2: 教师
	 * 3: 管理员
	 */
	private Integer userType;		//人员类型(根据用户类型分权限)
	private Date createDate;			//人员创建(录入)时间
	
	//学生属于某一个班级
	@ManyToOne(optional=true)
	@JoinColumn(name="class_id")
	private StudentClass studentClass;
	
	@ManyToOne(optional=true)
	@JoinColumn(name="exam_place_id")
	private ExamPlaceEntity examPlace;
	
	//一个学生有多个成绩
	@OneToMany(mappedBy="projectUser", fetch=FetchType.LAZY)
	private Set<ScoreEntity> scoreEntities;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getLoginName() {
		return loginName;
	}

	public void setLoginName(String loginName) {
		this.loginName = loginName;
	}

	public String getPwd() {
		return pwd;
	}

	public void setPwd(String pwd) {
		this.pwd = pwd;
	}

	public Integer getSex() {
		return sex;
	}

	public void setSex(Integer sex) {
		this.sex = sex;
	}

	public String getExamineeNumber() {
		return examineeNumber;
	}

	public void setExamineeNumber(String examineeNumber) {
		this.examineeNumber = examineeNumber;
	}

	public Integer getIsTransientStu() {
		return isTransientStu;
	}

	public void setIsTransientStu(Integer isTransientStu) {
		this.isTransientStu = isTransientStu;
	}

	public String getSubjectType() {
		return subjectType;
	}

	public void setSubjectType(String subjectType) {
		this.subjectType = subjectType;
	}

	public Date getBirthDay() {
		return birthDay;
	}

	public void setBirthDay(Date birthDay) {
		this.birthDay = birthDay;
	}

	public String getUserNo() {
		return userNo;
	}

	public void setUserNo(String userNo) {
		this.userNo = userNo;
	}

	public Integer getUserType() {
		return userType;
	}

	public void setUserType(Integer userType) {
		this.userType = userType;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public StudentClass getStudentClass() {
		return studentClass;
	}

	public void setStudentClass(StudentClass studentClass) {
		this.studentClass = studentClass;
	}

	public ExamPlaceEntity getExamPlace() {
		return examPlace;
	}

	public void setExamPlace(ExamPlaceEntity examPlace) {
		this.examPlace = examPlace;
	}

	public Set<ScoreEntity> getScoreEntities() {
		return scoreEntities;
	}

	public void setScoreEntities(Set<ScoreEntity> scoreEntities) {
		this.scoreEntities = scoreEntities;
	}
	
	
}

